package com.dinglian.ots.dao.mapper;

import com.dinglian.ots.dao.model.Category;
import com.dinglian.ots.dao.model.CategoryExample;
import java.util.List;
import java.util.Map;

import com.dinglian.ots.vo.product.CategoryVo;
import com.dinglian.ots.vo.product.ProductCategoryVo;
import com.dinglian.ots.vo.product.ProductSubcategoryVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

public interface CategoryMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int countByExample(CategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int deleteByExample(CategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int insert(Category record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int insertSelective(Category record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    List<Category> selectByExampleWithRowbounds(CategoryExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    List<Category> selectByExample(CategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    Category selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(Category record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_category
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(Category record);

    /**
     * 获取品类列表
     * @return
     */
    List<CategoryVo> getCategoryList();

    /**
     * 通过品类名称查找ID
     * @param categoryName
     * @return
     */
    Integer getCategoryIdByName(@Param("categoryName") String categoryName);

    /**
     * 获取二级品类列表
     * @return
     */
    List<ProductSubcategoryVo> getSubcategoryList(Integer categoryId);

    /**
     * 获取分类名
     * @param brandId
     * @return
     */
    List<CategoryVo> getCategoryByBrandId(@Param("brandId") Integer brandId);

    /**
     * 获取所有一级分类
     * @return
     */
    List<ProductCategoryVo> getOneCategoryList();
}